import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
// 注册树形表格插件 vue-table-with-tree-grid 全局注册
import Treetable from "vue-table-with-tree-grid";

Vue.component("tree-table", Treetable);
Vue.use(ElementUI);

// 注册全局过滤器
Vue.filter("dateFormat", function (originValue) {
  const date = new Date(originValue);
  const y = date.getFullYear();
  const m = (date.getMonth() + 1 + "").padStart(2, "0");
  const d = (date.getDate() + "").padStart(2, "0");
  const hh = (date.getHours() + "").padStart(2, "0");
  const mm = (date.getMinutes() + "").padStart(2, "0");
  const ss = (date.getSeconds() + "").padStart(2, "0");

  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`;
});

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
